<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            padding-bottom: 800px;
        }
        .red{
            color: red;
        }
        .blue{
            color: blue;
        }
    </style>
</head>
<body>
    <!-- 
        IDL 语言规范
    -->
    
    <div id="app">
        
        <!-- <table>
            <tr>
                <td colspan="2" rowspan="2">1</td>
            </tr>
        </table>
        <input type="text" value="aaa">
        <br>
        <select value="c">
            <option value="a">a</option>
            <option value="b">b</option>
            <option value="c">c</option>
            <option value="d">d</option>
        </select> -->

        <h5>v-bind 指令，用于绑定属性并增加具有响应式的动态数据值</h5>
        <!-- v-bind:操作属性名=" 属性的动态取值 " -->
        <p v-bind:class=" c ">绑定red的样式</p>
        <!-- v-bind 绑定属性时，可以通过 : 简化绑定语法 -->
        <p :class=" c ">绑定red的样式</p>
        <hr>
        <p>vue会自动根据绑定的属性识别 HTML属性 或 DOM属性(IDL属性)==>名称不冲突的情况下</p>
        <input type="button" value="A" @click="value='A' ">
        <input type="button" value="B" @click="value='B' ">
        <input type="button" value="C" @click="value='C' ">
        <input type="button" value="D" @click="value='D' ">
        <br>
        <!-- 
            select 没有 html 属性value； 但select 有 DOM 属性value 
            select DOM 属性value的操作会直接影响页面的选中状态
        -->
        <select :value=" value ">
            <option value="A">A</option>
            <option value="B">B</option>
            <option value="C">C</option>
            <option value="D">D</option>
        </select>
        <hr>
        <p>vue的v-bind完成的属性绑定，是由vue核心程序自行决定选择规范，无法手动改变</p>
        <p :class=" c ">绑定red的样式</p>
        <p :className=" c ">绑定red的样式</p>
        <p :class-name=" c ">绑定red的样式</p>
        <p :class-name.prop=" c ">绑定red的样式</p>
        <p :className.prop=" c ">绑定red的样式</p>

    </div>
    <script type="module"> 
        import { createApp } from "../assets/vue3/vue.esm-browser.js";
        createApp({
            data(){
                return {
                    c:"red",
                    value:"A"
                }
            }
        }).mount("#app")
    </script>
</body>
</html>